package com.controller;


import com.common.Result;
import com.pojo.Photo;
import com.service.PhotoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "图片", value = "图片")
@CrossOrigin
@RestController
public class PhotoController {

    @Autowired
    PhotoService photoService;

    @ApiOperation(value = "查询图片", httpMethod = "GET")
    @GetMapping(value = "/api/selectPhoto")
    public Result selectAllProducts(){
        List<Photo> photos = photoService.selectPhoto();
        return Result.seccess(200, "查询成功", photos);
    }

}
